<div class="row">
    <div class="panel panel-default">
        <div class="panel-heading panel-title" data-toggle="collapse" data-target="#deadSteps" >
          Dead Steps <span class="glyphicon glyphicon-menu-down"></span>
        </div>
        <div id="deadSteps" class="panel-body collapse">
          <span class="button-bar">
            <%= build_page(cuke_sniffer, "expand_and_collapse_buttons.html.erb") %>
          </span>
          <div>
            <% dead_steps = cuke_sniffer.get_dead_steps %>
            <% dead_steps.delete(:total) %>
            <% dead_step_count = dead_steps.values.flatten.count %>
            <% if !cuke_sniffer.cataloged? %>
                <div class="notes">Steps were not cataloged.</div>
            <% elsif dead_step_count == 0 %>
                <div class="notes">No dead steps found!</div>
            <% elsif dead_step_count == 1 %>
                <div class="notes"><%= dead_step_count %> Dead Step found.</div>
            <% else %>
                <div class="notes"><%= dead_step_count %> Dead Steps found.</div>
            <% end %>
          </div>
          <% unless dead_steps.empty? or !cuke_sniffer.cataloged? %>
              <% dead_steps.each_key do |file_name| %>
                <div class="deadStep">
                  <div class="row">
                    <div class="title col-md-12">
                        <div class="col-md-1">
                          <span class="red" title="Total dead steps in file.">
                            <%= dead_steps[file_name].size %>
                          </span>
                        </div>
                        <div class="col-md-11 filename">
                          <%= file_name.gsub(cuke_sniffer.step_definitions_location, "").gsub(cuke_sniffer.step_definitions_location, "") %>.rb
                        </div>
                    </div>
                    <div class="details col-md-12" style="display:none;">
                      <div class="well">
                        <div class="row">
                          <div class="col-md-12 filename">
                            File: <a target="_blank" href="file:///<%= file_name %>.rb" title="Note: Links to file on system this report was generated.">
                            <%= file_name.gsub(cuke_sniffer.step_definitions_location, "").gsub(cuke_sniffer.step_definitions_location, "") %>.rb
                          </a>
                          </div>
                            <% dead_steps[file_name].each do |regex| %>
                                <div class="col-md-11">
                                  <%= regex.match(/:(?<regex>.*)/)[:regex] %>
                                </div>
                                <div class="col-md-1">
                                  Line: <%= regex.match(/(?<line>\d+):/)[:line] %>
                                </div>
                            <% end %>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              <% end %>
          <% end %>
        </div>
    </div>
</div>